<?php
if(!defined('MY_ROOT'))
{
throw new Exception('Access Denied');
}
if($_G['uid']>0)
{showmessage('alert',_('You already logged in'),false,'index.php');}
$smarty=$_G['hwnd']['smarty'];
$member=&$_G['hwnd']['member'];
if($_REQUEST['action']=='forget')
{
if($_REQUEST['username']=='')
{
$smarty->display('member/forgetpass.tpl');
}else{
$member->forgetpass($_POST['username']);
showmessage('success',_('email sent'),false);
}
}elseif($_REQUEST['action']=='confirm')
{
$smarty->assign($_GET);
$smarty->display('member/forgconfirm.tpl');
}
elseif($_REQUEST['action']=='chpasswd')
{
$result=$member->fpasswd($_POST['username'],$_POST['hash'],$_POST['newpass']);
if($result<0)
{
showmessage('error',_('Hash key error'),false,'index.php');
}else{
showmessage('success',_('Password Changed'),'member.php?mod=login');
}
}else{
$smarty->display('member/forgetpass.tpl');
}
?>
